import sqlite3

conn = sqlite3.connect('database.db')
conn.row_factory = sqlite3.Row


def read_sql(sql: str):
    result = [tuple(row) for row in conn.execute(sql).fetchall()]
    return result


def write_sql(sql):
    result = conn.execute(sql)
    return result.rowcount
